//
//  WBDemoViewController.swift
//  TYCWeiBo
//
//  Created by 中发 on 2018/5/29.
//  Copyright © 2018年 中发. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        setTableView()
        //设置标题
        title = "第\(navigationController?.childViewControllers.count ?? 0)控制器"
    }

    //MARK:监听方法
    //继续push到一个新的控制器
    @objc private func showNext() {
        let vc = WBDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }

}

extension WBDemoViewController {
    //重写父类方法
    override func setTableView() {
        super.setTableView()
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
    }
}
